<template>
  <SimplenessLayout>
    <div class="parentCard">
      <a-card style="height: 76vh;overflow: auto">
        <PublicHead
            :label="'模型标签'"
            :add="addModel"
            :on-search="onSearch"
        ></PublicHead>
        <div style="height: 5px"></div>
        <ModelBody></ModelBody>
        <ModelPopup></ModelPopup>
        <AddMustPopup></AddMustPopup>
      </a-card>
    </div>
  </SimplenessLayout>
</template>

<script>
import SimplenessLayout from "@/layouts/SimplenessLayout";
import ModelBody from "@/pages/systemManage/modelManage/ModelBody";
import {mapActions, mapMutations} from 'vuex'
import ModelPopup from "@/pages/systemManage/modelManage/ModelPopup";
import AddMustPopup from "@/pages/systemManage/modelManage/AddMustPopup";
import PublicHead from "@/components/share/PublicHead";

export default {
  name: "ModelManage",
  components: {PublicHead, AddMustPopup, ModelPopup, ModelBody, SimplenessLayout},
  created() {
    this.setState({name: 'queryForm', value: {}})
    this.queryModelList()
  },
  methods: {
    ...mapActions('modelManage', ['queryModelList']),
    ...mapMutations('modelManage', ['setState']),
    onSearch(val) {
      this.setState({name: 'queryForm', value: {modelName: val}})
      this.queryModelList()
    },
    addModel() {
      this.setState({name: 'modalTitle', value: '新建模型'})
      this.setState({name: 'modalVisible', value: true})
    }
  }
}
</script>

<style scoped>
.parentCard >>> .ant-card-body {
  padding: 0 16px;
}
</style>
